<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib uri="/WEB-INF/tlds/att.tld" prefix="att"%>
<html>
<head>
<meta name="decorator" content="moduleView" />
<script src="${staticPath}/lib/accounting/0.3.2/accounting.min.js"
	type="text/javascript"></script>
<script type="text/javascript">
	function getUrl(url, iframeId) {
		var frame = $("#" + iframeId);
		if (!frame.attr("src")) {
			frame.attr("src", url);
		}
	}
	$(document).ready(
			function() {
					});
</script>
</head>
<body>
	<div class="Report_f">
		<div class="Report_f_1">
			<div class="Report_f_title_1">自营对账单</div>
			<div class="o-l-action">
				<a class="btn btn-default btn-sm btn_5 pull-right" role="button"
					href="javascript:void(0)" onclick="history.go(-1)">返回</a>
			    <%-- <a class="btn btn-success btn-sm btn_5 pull-right" role="button"
					href="${contextPath}/statement/stm/prepaid/exportPrepaidAndDetail?id=${stmPrepaid.id}&billNo=${stmPrepaid.billNo}">导出</a>
				 <a class="btn btn-warning btn-sm btn_5 pull-right" role="button"
					href="${contextPath}/statement/stm/error/add?billNo=${stmPrepaid.billNo}&statementType=ZJ00"><span
					class="glyphicon glyphicon-exclamation-sign"></span>录入异常</a>
				 <a class="btn btn-success btn-sm pull-right" role="button"
						href="${contextPath}/statement/mainSelfrun/confirmPrepaid?id=${statementMainSelfrun.id}">确认对账</a> --%>
			</div>
			<div class="tab-content Report_f_title_3">
				<div class="Report_f_title_5">
					<div class="col-sm-2 leftbar_1">
						<ul class="nav Report_f_title_6">
							<li><a href="#label_1" data-toggle="tab">详细信息</a></li>
							<li><a href="#label_2" data-toggle="tab"
								onclick="getUrl('${contextPath}/statement/stm/error/showStatementErrorList?statementType=ZJ00&billNo=${stmPrepaid.billNo}','errorStatementFrame')">对账异常</a></li>
						</ul>
					</div>
					<div class="tab-content Report_f_title_3">
						<div class="tab-pane active" id="label_1">
							<table class="table table-bordered">
								<tbody>
									<tr>
										<td class="text-left" style="width: 20%"><strong>对账单号:</strong></td>
										<td style="width: 30%">${statementMainSelfrun.billNo}</td>
										
										<td class="text-left" style="width: 20%"><strong>是否已对账:</strong></td>
										<td style="width: 30%"><ossp:value dictType="RECONCILIATION_TYPE" key="${statementMainSelfrun.isReconciliation}"></ossp:value></td>
									</tr>
									<tr>
									    <td class="text-left" style="width: 20%"><strong>供应商编码:</strong></td>
										<td style="width: 30%">${statementMainSelfrun.supplierNo}</td>
									    <td class="text-left" style="width: 20%"><strong>供应商合同号:</strong></td>
										<td style="width: 30%">${statementMainSelfrun.contractNumber}</td>
									</tr>
									<tr>
										<td class="text-left" style="width: 20%"><strong>结算期间:</strong></td>
										<td style="width: 30%"><fmt:formatDate
												value="${statementMainSelfrun.startTime}" pattern="yyyy-MM-dd" />&nbsp;&nbsp;至&nbsp;&nbsp;<fmt:formatDate
												value="${statementMainSelfrun.endTime}" pattern="yyyy-MM-dd" /></td>

										<td class="text-left" style="width: 20%"><strong>供应商名称:</strong></td>
										<td style="width: 30%">${statementMainSelfrun.supplierName}</td>
									</tr>
									<tr>
										<td class="text-left" style="width: 20%"><strong>货款净额(元):</strong></td>
										<td style="width: 30%"><fmt:formatNumber
												value="${statementMainSelfrun.netPayment}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>

										<td class="text-left" style="width: 20%"><strong>货款税额(元):</strong></td>
										<td style="width: 30%"><fmt:formatNumber
												value="${statementMainSelfrun.taxPayment}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>
									</tr>
									<tr>
										<td class="text-left" style="width: 20%"><strong>货款金额(元):</strong></td>
										<td style="width: 30%"><fmt:formatNumber
												value="${statementMainSelfrun.amountPayment}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>

										<td class="text-left" style="width: 20%"><strong>调价净额(元):</strong></td>
										<td style="width: 30%"><fmt:formatNumber
												value="${statementMainSelfrun.netPriceADJ}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>
									</tr>
									<tr>
										<td class="text-left" style="width: 20%"><strong>调价税额(元):</strong></td>
										<td style="width: 30%"><fmt:formatNumber
												value="${statementMainSelfrun.taxPriceADJ}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>

										<td class="text-left" style="width: 20%"><strong>调价金额(元):</strong></td>
										<td style="width: 30%"><fmt:formatNumber
												value="${statementMainSelfrun.amoutPriceADJ}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>
									</tr>
									<tr>
										<td class="text-left" style="width: 20%"><strong>返利净额(元):</strong></td>
										<td style="width: 30%"><fmt:formatNumber
												value="${statementMainSelfrun.netRebate}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>

										<td class="text-left" style="width: 20%"><strong>返利税额(元):</strong></td>
										<td style="width: 30%"><fmt:formatNumber
												value="${statementMainSelfrun.taxRebate}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>
									</tr>
									<tr>
										<td class="text-left" style="width: 20%"><strong>返利金额(元):</strong></td>
										<td style="width: 30%"><fmt:formatNumber
												value="${statementMainSelfrun.amoutRebate}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>

										<td class="text-left" style="width: 20%"><strong>费用金额(元):</strong></td>
										<td style="width: 30%"><fmt:formatNumber
												value="${statementMainSelfrun.feeAmount}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>
									</tr>
									<tr>
										<td class="text-left" style="width: 20%"><strong>进货金额(元):</strong></td>
										<td style="width: 30%"><fmt:formatNumber
												value="${statementMainSelfrun.purchaseAmount}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>

										<td class="text-left" style="width: 20%"><strong>退货金额(元):</strong></td>
										<td style="width: 30%"><fmt:formatNumber
												value="${statementMainSelfrun.returnAmount}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>
									</tr>
								</tbody>
							</table>
							<div class="o-l-search-builder f_9">
								<h4>采购/调价明细</h4>
								<table
									class="table table-striped table-hover o-l-table table-bordered"
									id="table1">
									<thead class="t_1">
										<tr>
											<th style="width: 200px">事务类型</th>
											<th style="width: 120px">开票类型</th>
											<th style="width: 120px">含税金额</th>
										</tr>
									</thead>
									<tbody>
										<c:forEach items="${statementMainDetail1List}" var="mainDetail1">
											<tr>
												<td><ossp:value dictType="TRANTYPE"
														key="${mainDetail1.type}"></ossp:value></td>
												<td><ossp:value dictType="INVOICETYPE"
														key="${mainDetail1.billingType}"></ossp:value></td>
												<td><fmt:formatNumber
												value="${mainDetail1.taxAmount}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>
											</tr>
										</c:forEach>
									</tbody>
								</table>
							</div>
							<div class="o-l-search-builder f_9">
								<h4>扣费明细/返利明细</h4>
								<table
									class="table table-striped table-hover o-l-table table-bordered"
									id="table1">
									<thead class="t_1">
										<tr>
											<th>事务类型</th>
											<th>扣款金额</th>
											<th>开票类型</th>
											<th>税金额</th>
											<th>金额合计</th>
										</tr>
									</thead>
									<tbody>
										<c:forEach items="${statementMainDetail2List}"
											var="mainDetail2">
											<tr>
												<td><ossp:value dictType="TRANTYPE"
														key="${mainDetail2.type}"></ossp:value></td>
												<td><fmt:formatNumber
												value="${mainDetail2.paymentAmount}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>
												<td><ossp:value dictType="INVOICETYPE"
														key="${mainDetail2.billingType}"></ossp:value></td>
												<td><fmt:formatNumber
												value="${mainDetail2.taxAmount}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>
												<td><fmt:formatNumber
												value="${mainDetail2.totalAmount}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>
											</tr>
										</c:forEach>
									</tbody>
								</table>
							</div>
							
							<div class="o-l-search-builder f_9">
								<h4>销售明细</h4>
								<table
									class="table table-striped table-hover o-l-table table-bordered"
									id="table1">
									<thead class="t_1">
										<tr>
											<th>事务类型</th>
											<th>物料编号</th>
											<th>数量</th>
											<th>净额</th>
										</tr>
									</thead>
									<tbody>
										<c:forEach items="${statementMainDetail3List}"
											var="mainDetail3">
											<tr>
												<td><ossp:value dictType="TRANTYPE"
														key="${mainDetail3.type}"></ossp:value></td>
												<td>${mainDetail3.materialNo}</td>
												<td>${mainDetail3.quantity}</td>
												<td><fmt:formatNumber
												value="${mainDetail3.netAmount}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>
											</tr>
										</c:forEach>
									</tbody>
								</table>
							</div>
						</div>
						<div class="tab-pane" id="label_2">
							<iframe id="errorStatementFrame" name="errorStatementName"
								scrolling="no" frameborder="no" width="100%"></iframe>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>